package com.mapper;

import com.pojo.SStudents;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
* @author fujiaqing
* @description 针对表【s_student】的数据库操作Mapper
* @createDate 2024-11-19 15:28:33
* @Entity com.pojo.SStudents
*/
public interface SStudentsMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SStudents record);

    int insertSelective(SStudents record);

    SStudents selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SStudents record);

    int updateByPrimaryKey(SStudents record);

    @Select("select * from s_student where id = #{id}")
    SStudents selectSStudentsById (int id);

    @Update("update s_student set name = #{name},age = #{age},cid = #{cid}"+" where id = #{id}")
    int updateStudents(SStudents record);

    @Select("select * from s_student where cid = #{id}")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "sge",property = "age"),
    })
    List<SStudents> selectStudentsByUserId(int id);

}
